#ifndef SCANNER_H
#define SCANNER_H

#include <QUdpSocket>
#include <QHostAddress>
#include <QString>
#include <QChar>
#include <QByteArray>
#include "contactlistmanager.h"

class scanner
{
public:
    static const int invisible_mode = 0;
    static const int friends_mode = 1;
    static const int public_mode = 2;
    static const char *magic_label;
    scanner(int listener_port, int teller_port, ContactListManager *contactlistmanager,
            int initial_mode, QString alias);
    void broadcastyourself();
    void update();
    void switchmode(int mode);
private:
    int mode;
    int time_since_last_broadcast;
    int time_online;
    int listener_port;
    int teller_port;
    ContactListManager *contactlistmanager;
    QString alias;
    QUdpSocket udp_socket;
};

#endif // SCANNER_H
